import java.util.Scanner;

public class Challenge4
{
	
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		String operation = "";
		while ((!operation.equals("q")) && (!operation.equals("Q")))
		{
			if ((!operation.equals("q")) && (!operation.equals("Q")))
			{
				System.out.println("Enter your first number: ");
				String num1str = input.next();
				Double num1 = Double.parseDouble(num1str);
				while ((!operation.equals("q")) && (!operation.equals("Q")))
				{
					if ((!operation.equals("q")) && (!operation.equals("Q")))
					{
						System.out.println("Enter your operation: ");
						System.out.println("*");
						System.out.println("+");
						System.out.println("-");
						System.out.println("/");
						operation = input.next();
						if ((!operation.equals("q")) && (!operation.equals("Q")))
						{
							System.out.print("Enter your next number: ");
							String num2str = input.next();
							Double num2 = Double.parseDouble(num2str);
							if (operation.equals("*"))
							{
								System.out.println(num1 + operation + num2 + "=" + (num1 * num2));
								num1 = (num1 * num2);
							}
							if (operation.equals("/"))
							{
								System.out.println(num1 + operation + num2 + "=" + (num1 / num2));
								num1 = (num1 / num2);
							}
							if (operation.equals("+"))
							{
								System.out.println(num1 + operation + num2 + "=" + (num1 + num2));
								num1 = (num1 + num2);
								
							}
							if (operation.equals("-"))
							{
								
								System.out.println(num1 + operation + num2 + "=" + (num1 - num2));
								num1 = (num1 - num2);
							}
						}
					}
				}
			}
		}
	}
}